//
//  NoticeCategoryTableViewCell.m
//  XTXOneToOne
//
//  Created by Canny on 2018/11/9.
//  Copyright © 2018年 WK. All rights reserved.
//

#import "NoticeCategoryTableViewCell.h"

@interface NoticeCategoryTableViewCell ()

@property(nonatomic, strong) UILabel * lab1;

@end


@implementation NoticeCategoryTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        [self initView];
    }
    return self;
}

-(void)setLab:(UILabel *)lab withColor:(UIColor *)color andFont:(CGFloat)font andText:(NSString *)text andTextAlignment:(NSTextAlignment)textAlignment{
    lab.text=text;
    lab.textColor=color;
    lab.font=[UIFont systemFontOfSize:font];
    lab.textAlignment=textAlignment;
}


- (void)initView{
    
    self.backgroundColor=[UIColor whiteColor];
    
    
    UILabel * lab1 = [[UILabel alloc]init];
    [self addSubview:lab1];
    [self setLab:lab1 withColor:RGB(40, 40, 40) andFont:15 andText:@"加载中" andTextAlignment:NSTextAlignmentLeft];
    [lab1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(15);
        make.centerY.equalTo(self.mas_centerY).offset(0);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(300);
    }];
    _lab1=lab1;
    
    UIImageView * imgVArrow = [[UIImageView alloc]init];
    [self addSubview:imgVArrow];
    //    imgVArrow.backgroundColor=[UIColor cyanColor];
    [imgVArrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).offset(-20);
        make.centerY.equalTo(self.mas_centerY);
        make.width.equalTo(@(9));
        make.height.equalTo(@(18));
    }];
    imgVArrow.image=[UIImage imageNamed:@"进入icon"];
    
    UIView * line = [[UIView alloc]init];
    [self addSubview:line];
    line.backgroundColor=RGB(232, 234, 237);

    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).offset(-20);
        make.left.equalTo(self.mas_left).offset(15);
        make.bottom.equalTo(self.mas_bottom).offset(0);
        make.height.equalTo(@(1));
    }];
}


- (void)setDataSource:(NoticeCategoryModel *)dataSource{
    _dataSource=dataSource;
    if (dataSource) {
        _lab1.text = dataSource.title;
    }
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


+(CGFloat)computeHeight:(id)info{
    
    return 50;
    
}
@end
